#pragma once
#include"public_struct.h"
class MinStack {
public:
	/** initialize your data structure here. */
	stack<int> s;
	stack<int> s_min;
	MinStack() {
		s_min.push(INT_MAX);
	}
	void push(int x) {
		s.push(x);
		s_min.push(min(s_min.top(), x));
	}

	void pop() {
		s.pop();
		s_min.pop();
	}

	int top() {
		return s.top();
	}

	int getMin() {
		return s_min.top();
	}
};

/**
 * Your MinStack object will be instantiated and called as such:
 * MinStack* obj = new MinStack();
 * obj->push(x);
 * obj->pop();
 * int param_3 = obj->top();
 * int param_4 = obj->getMin();
 */